<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@ taglib prefix="sec" uri="/WEB-INF/tags/shiro.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>条目权限设置</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<% 
Object lang=session.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
String languageCode="zh_CN";
if(lang!=null){
	languageCode=lang.toString();
}
	Locale locale =SessionHelper.getLocaleByUser(request);
%>
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
<jsp:include page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<script type="text/javascript" src="avicit/im/lantop/userauthset/EntryAuthSet.js"></script>
<jsp:include page="/avicit/platform6/modules/system/commonpopup/commonSelectionHead.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript" src="avicit/im/lantop/userauthset/locale/language_<%=languageCode%>.js"></script>
<script type="text/javascript">
	dialogId = "${dialogId}";
	nodeIds = "${nodeIds}";
	targetId = "${targetId}";
	targetType = "${targetType}";
	userAuthColSize = "${userAuthColSize}";
	rcdDataType = "${rcdDataType}";
	authCount = "${authCount}";
</script>
</head>
<body class="easyui-layout">
	<div id="leftDiv" data-options="region:'west',split:false" style="width:360px;">
		<!-- 待选择条目 begin -->
		<div>
			<table class="tableForm" id="roleSearchForm" width='90%' style="margin-left:59px;">
				<tr>
					<%-- 条目类型 --%>
					<td style="height:36px;">
						<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.entryType","i18n.lantop",locale)%>:
						<select id="entryTypeCombobox" class="easyui-combobox" name="entryTypeCombobox" style="width:200px;" editable="false">   
						    <c:forEach var="entryType" items="${entryTypeList }">
						    	<option value="${entryType.code }" selected="selected">${entryType.name }</option>  
						    </c:forEach>
						</select>  
					</td>
				</tr>
			</table>
		</div>

		<div id="toolbarWaitSelectEntry" class="datagrid-toolbar" style="height:auto; display: block;" >
			<form id="formEntrySearch" method="post">
				<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_formEntrySearch_wjh">
					<div id="wjhDiv" class="formUnit column1">
						<%-- 文件号 --%>
						<label for="tempCode"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.fileNum","i18n.lantop",locale)%></label>
						<div class="inputContainer">
							<input style="width: 200px;" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.fileNum","i18n.lantop",locale)%>"
								class="easyui-validatebox" id="WJH" name="WJH" />
						</div>
					</div>
				</sec:accesscontrollist>
				
				<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_formEntrySearch_tm">
					<div id="tmDiv" class="formUnit column1">
						<%-- 题名 --%>
						<label for="tempCode"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.title","i18n.lantop",locale)%></label>
						<div class="inputContainer">
							<input style="width: 200px;" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.title","i18n.lantop",locale)%>"
								class="easyui-validatebox" id="TM" name="TM" />
						</div>
					</div>
				</sec:accesscontrollist>
				
				<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_formEntrySearch_attachName">
					<div id="attachNameDiv" class="formUnit column1">
						<label for="tempCode"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.elecFileName","i18n.lantop",locale)%></label>
						<div class="inputContainer">
							<input style="width: 200px;" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.elecFileName","i18n.lantop",locale)%>"
								class="easyui-validatebox" id="ATTACH_NAME" name="ATTACH_NAME" />
						</div>
					</div>
				</sec:accesscontrollist>

				<table class="tableForm" width="100%" border=0>
					<tr>
						<td colspan="4">
							<div align="center">
								<sec:accesscontrollist hasPermission="3"
									domainObject="userauthset_EntryAuthSet_button_searchData">
									<%-- 查询 --%>
									<a class="easyui-linkbutton  selbtnc" iconCls="icon-search"
										onclick="searchData();"
										href="javascript:void(0);">
										<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.button.search","i18n.lantop",locale)%>
										</a>
								</sec:accesscontrollist>
								<sec:accesscontrollist hasPermission="3"
									domainObject="userauthset_EntryAuthSet_button_cancelForm">
									<%-- 重置 --%>
									<a class="easyui-linkbutton  selbtnc" iconCls="icon-redo"
										onclick="cancelForm();"
										href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.button.reset","i18n.lantop",locale)%></a>
								</sec:accesscontrollist>
							</div>
						</td>
					</tr>

				</table>
			</form>
			<sec:accesscontrollist  hasPermission="3" domainObject ="userauthset_EntryAuthSet_button_addEntryToAuthEntry">
				<%-- 添加 --%>
				<td width="70px;">
				<a title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table.button.add","i18n.lantop",locale)%>" class="easyui-linkbutton  selbtnc" iconCls="icon-im-add"  onclick="addEntryToAuthEntry();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table.button.add","i18n.lantop",locale)%></a></td>
			</sec:accesscontrollist>
			<sec:accesscontrollist  hasPermission="3" domainObject ="userauthset_EntryAuthSet_button_closeWindow">
				<%-- 返回 --%>
				<td width="70px;"><a title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table.button.return","i18n.lantop",locale)%>" class="easyui-linkbutton  selbtnc" iconCls="icon-im-back"  onclick="closeWindow();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table.button.return","i18n.lantop",locale)%></a></td>
			</sec:accesscontrollist>
		</div>
    	<table id="waitSelectEntryDatagrid" class="easyui-datagrid"
			data-options="
						url: 'platform/UserAuthSetController/getWaitSelectEntry?targetId=${targetId }&targetType=${targetType }&nodeIds=${nodeIds }',
						animate: false,
						collapsible: false,
						fitColumns: true,
						autoRowHeight: false,
						singleSelect: true,
						pagination:true,
						pageNumber:0,
						pageSize:20, 
						pageList:[20,30,50],
			    		striped:true,
						fit:true,
						method: 'post',
						selectOnCheck: false,
						checkOnSelect: false,
						toolbar: '#toolbarWaitSelectEntry'
					">
			<thead>
				<tr>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_waitSelectEntryDatagrid_id">
						<th data-options="field:'ID', halign:'center',checkbox:true"
							title="主键ID" width="20">主键ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_waitSelectEntryDatagrid_archiveClassNodeName">
						<%-- 节点名称 --%>
						<th data-options="field:'ARCHIVE_CLASS_NODE_NAME', halign:'center', align:'center'"
							 title="节点名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table.nodeName","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_waitSelectEntryDatagrid_wjh">
						<%-- 文件号 --%>
						<th data-options="field:'WJH', halign:'center', align:'center'"
							width="120" title="文件号" ><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table.fileNum","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_waitSelectEntryDatagrid_tm">
						<%-- 题名 --%>
						<th data-options="field:'TM', halign:'center', align:'center'"
							width="120" title="题名" ><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table.title","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_waitSelectEntryDatagrid_attachName">
						<th data-options="field:'ATTACH_NAME', halign:'center', align:'center'"
							width="120" title="电子文件名称" ><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.elecFileName","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<!-- 以下为隐藏列，业务字段 -->
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_waitSelectEntryDatagrid_tableId">
						<th data-options="field:'TABLE_ID', halign:'center', align:'center', hidden:true"
							 title="物理表ID">物理表ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_waitSelectEntryDatagrid_archiveClassId">
						<th data-options="field:'ARCHIVE_CLASS_ID', halign:'center', align:'center',hidden:true"
							 title="档案分类树ID">档案分类树ID</th>
					</sec:accesscontrollist>
				</tr>
			</thead>
		</table>
    	<!-- 待选择条目 end -->
    </div>
    <div data-options="region:'center',split:false" style="width:220px;text-align: center;">
		<!-- 已设置条目权限列表 begin -->

		<div id="toolbarAuthEntry" class="datagrid-toolbar" style="height: 40px; display: block; ">
			<sec:accesscontrollist  hasPermission="3" domainObject ="userauthset_EntryAuthSet_button_saveAuthEntry">
				<%-- 保存 --%>
				<a style="margin-top:7px;" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.button.save","i18n.lantop",locale)%>" class="easyui-linkbutton selbtnc" iconCls="icon-im-save"  onclick="saveAuthEntry();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.button.save","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist  hasPermission="3" domainObject ="userauthset_EntryAuthSet_button_delAuthEntry">
				<%-- 删除 --%>
				<a title="<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.button.delete","i18n.lantop",locale)%>" class="easyui-linkbutton selbtnc" iconCls="icon-im-remove"  onclick="delAuthEntry();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.button.delete","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<%-- 开始日期 --%>
			<sec:accesscontrollist  hasPermission="3" domainObject ="userauthset_EntryAuthSet_button_startDate">
						<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.startDate","i18n.lantop",locale)%>：<input id="startDate" name="startDate" type="text" class="easyui-datebox"
							style="width: 100px;" editable="false" ></input>
			</sec:accesscontrollist>
			<%-- 结束日期 --%>
			<sec:accesscontrollist  hasPermission="3" domainObject ="userauthset_EntryAuthSet_button_delAuthEntry">
						<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.endDate","i18n.lantop",locale)%>：<input id="endDate" name="endDate" type="text" class="easyui-datebox"
							style="width: 100px;" editable="false"></input>
			</sec:accesscontrollist>
		
		</div>
		<table id="authEntryDatagrid" class="easyui-datagrid"
			data-options="
						url: 'platform/UserAuthSetController/getAuthEntry?targetId=${targetId }&targetType=${targetType }&nodeIds=${nodeIds }',
						animate: false,
						collapsible: false,
						fitColumns: true,
						autoRowHeight: false,
						singleSelect: true,
						pagination:true,
						pageNumber:0,
						pageSize:20, 
						pageList:[20,30,50],
			    		striped:true,
						fit:true,
						method: 'post',
						selectOnCheck: false,
						checkOnSelect: false,
						toolbar: '#toolbarAuthEntry'
					">
			<thead>
				<tr>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_id">
						<th data-options="field:'ID', halign:'center',checkbox:true"
							title="主键ID" width="20">主键ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_archiveClassNodeName">
						<%-- 节点名称 --%>
						<th data-options="field:'ARCHIVE_CLASS_NODE_NAME', halign:'center', align:'center', sortable:false,editor:{type:'text'}"
							width="80" title="节点名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.nodeName","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_wjh">
						<%-- 文件号 --%>
						<th data-options="field:'WJH', halign:'center', align:'center', sortable:false,editor:{type:'text'}"
							width="80" title="文件号"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.fileNum","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_tm">
						<%-- 题名 --%>
						<th data-options="field:'TM', halign:'center', align:'center', sortable:false,editor:{type:'text'}"
							width="80" title="题名"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.title","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_attachName">
						<%-- 电子文件名称 --%>
						<th data-options="field:'ATTACH_NAME', halign:'center', align:'center', sortable:false,editor:{type:'text'}"
							width="90" title="电子文件名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.elecFileName","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_attachName">
						<%-- 授权开始时间 --%>
						<th data-options="field:'START_DATE', halign:'center', align:'center', sortable:false,editor:{type:'text'},formatter:formatTooltipDate"
							width="90" title="授权开始时间"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.authStartTime","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_attachName">
						<%-- 授权结束时间 --%>
						<th data-options="field:'END_DATE', halign:'center', align:'center', sortable:false,editor:{type:'text'},formatter:formatTooltipDate"
							width="90" title="授权结束时间"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.userauthset.userauthset.button.entryAuthSet.table2.authEndTime","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<c:forEach var="rowCol" items="${userAuthColList}" >
						<c:if test="${rowCol.code != 'A3'}">
							<sec:accesscontrollist hasPermission="3" domainObject="_${rowCol.code}">
								<th data-options="field:'${rowCol.code}', halign:'center', align:'center', sortable:false,editor:{type:'text'},formatter:formatCheckbox"
									width="65" title="${rowCol.name}">${rowCol.name}</th>
							</sec:accesscontrollist>
						</c:if>
					</c:forEach>
					<!-- 以下为隐藏列，业务字段 -->
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_tableId">
						<th data-options="field:'TABLE_ID', halign:'center', align:'center', sortable:false,editor:{type:'text'}, hidden:true"
							width="200" title="物理表ID">物理表ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_res_code">
						<th data-options="field:'RES_CODE', halign:'center', align:'center', sortable:false,editor:{type:'text'}, hidden:true"
							width="200" title="资源编码">资源编码</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_archiveClassId">
						<th data-options="field:'ARCHIVE_CLASS_ID', halign:'center', align:'center', sortable:false,editor:{type:'text'}, hidden:true"
							width="200" title="档案分类树ID">档案分类树ID</th>
					</sec:accesscontrollist>
					<!-- 隐藏域,保存条目类型 -->
					<sec:accesscontrollist hasPermission="3" domainObject="userauthset_EntryAuthSet_authEntryDatagrid_rcdDataType">
						<th data-options="field:'RCD_DATA_TYPE', halign:'center', align:'center',hidden:true"
							 title="条目类型">条目类型</th>
					</sec:accesscontrollist>
				</tr>
			</thead>
		</table>
		<!-- 已设置条目权限列表 end -->
	</div>
</body>
</html>
